import { defineConfig } from 'vitepress'
import { mdPlugin } from './config/plugins'
// 组件名称
// import vueSetupName from 'vite-plugin-vue-setup-extend'

export default defineConfig({
  title: 'DElPlus基础组件文档',
  description: '基于Elemend-plus基础组件封装使用',
  lang: 'cn-ZH',
  base: '/d-el-plus/',
  lastUpdated: true,
  themeConfig: {
    logo: '/favicon.ico',
    siteTitle: 'DElPlus基础组件文档',
    outline: 3,
    socialLinks: [{ icon: 'github', link: '' }],
    nav: [
      {
        text: '安装指南',
        link: '/components/'
      },
      { text: '基础组件', link: '/components/DButton/base.md' },

      {
        text: 'Gitee码云地址',
        link: ''
      },
      {
        text: '博客',
        link: 'https://www.djfiona.cn'
      }
    ],
    sidebar: {
      '/components': [
        {
          text: '兼容性问题汇总',
          items: [{ text: '解决方法', link: '/components/Tips/base.md' }]
        },
        {
          text: '表单组件',
          items: [
            { text: 'button按钮', link: '/components/DButton/base.md' },
            { text: 'radio单选', link: '/components/DRadio/base.md' },
            { text: 'checkbox多选', link: '/components/DCheckbox/base.md' },
            { text: 'input输入框', link: '/components/DInput/base.md' },
            { text: 'select下拉选择', link: '/components/DSelect/base.md' },
            { text: 'selectTree下拉树形选择', link: '/components/DSelectTree/base.md' },
            { text: 'selectTable下拉选择表格组件', link: '/components/DSelectTable/base.md' }
          ]
        },
        {
          text: '复杂组件',
          items: [
            { text: '表单组件', link: '/components/DForm/base.md' },
            { text: '分组表单组件', link: '/components/DGroupForm/base.md' },
            { text: 'table组件', link: '/components/DTable/base.md' },
            { text: '可编辑table组件', link: '/components/DEditTable/base.md' }
          ]
        },
        {
          text: '反馈组件',
          items: [
            { text: 'dialog弹窗', link: '/components/DDialog/base.md' },
            { text: 'drawer抽屉', link: '/components/DDrawer/base.md' }
          ]
        },
        {
          text: 'data数据展示',
          items: [{ text: '详情组件', link: '/components/DDetails/base.md' }]
        }
      ]
    }
  },
  markdown: {
    config(md) {
      mdPlugin(md)
    }
  }
  // vite: {
  //   plugins: [vueSetupName()],
  // },
})
